OPC Quality Mapping
The OPC EIEs include quality information that is specific only to the OPC devices.
DDS Data Group Transaction Header
In the Device Definition Service (DDS) the data group transaction headers contain a "quality" field to display the overall OPC quality status of the DEIDs in a data group.
Possible quality values are as follows:
- G - All Good
- P - Partially Good
- B - All Bad
- U - Unknown
Mapping OPC Quality to Point Status Bits in the Device Template File
In the OPC EIE device template file (DTF), an optional quality bit mapping section is provided that is specific only to the OPC device.
The qualityMapping section of the OPC EIE DTF is an optional section that provides a method to map OPC quality values to point status bits in the PNT. The quality bits represent the quality state for an item's data value. Only the quality bits that the user is interested in mapping need to be included in the device template file. If omitted, none of the quality bits will be mapped to CygNet status bits.
Each quality state may include the following attributes that map to CygNet point status bits in the PNT and indicate if the bit is set (true) or cleared (false):
- setUnreliable
- setUser1
- setUser2
- setUser3
- setUser4
- setUser5
- setUser6
- setUser7
- setUser8
- setUser9
- setUser10
- setUser11
- setUser12
- setUser13
- setUser14
- setUser15
- setUser16
See Point Status Bits for a description of CygNet status bits that can be mapped.
The low eight bits are defined in the form of three bit fields: Quality, Sub-status, and Limit status (QQSSSSLL). The following table describes OPC EIE Quality Mapping.
| Attribute | Description |
|---|---|
|
mask |
The bit mask is applied to the quality state received from the OPC server.
|
|
value |
If the masked quality bits equal the value specified in the qualityMapping section of the device template file, an action is taken using the following attributes:
|
|
updateValue |
Optional. Can be added to any mapped quality bit. When set to "false", the status bit(s) on the CygNet point will be updated, but the point value will retain the last value. The default setting is "true". See Using Sentinel Values to Indicate Unreliable Data for more information. |
Device Template File
The following example displays a sample qualityMapping structure.
<deviceDefinition deviceType="MatrikonSim" mfg="CygNet" desc="OPC Matrikon Simulator" category="4098" model="Generic" eieType="OPC" defaultSentinelValue="-9999" defaultUseSentinel="1" cygnetVersion="9.8.1000" customerVersion="">
<!--This template was developed using the Matrikon Simulator OPC server-->
...
<qualityMapping >
<StatBad mask="0xC0" value="0" setUnreliable="true" updateValue="false"/>
<StatUncert mask="0xC0" value="0x40" setUnreliable="true" updateValue="false"/>
<StatUnknwn mask="0xC0" value="0x80" setUnreliable="true" updateValue="false"/>
<!-- Quality 0 (bad) sub-status /-->
<BadX mask="0xFC" value="0x00" updateValue="false"/>
<CfgErr mask="0xFC" value="0x04" setUser1="true" />
<NotConn mask="0xFC" value="0x08" setUser2="true" />
<DevFail mask="0xFC" value="0x0C" setUser3="true" />
<SensFail mask="0xFC" value="0x10" setUser4="true" />
<LastKnown mask="0xFC" value="0x14" setUser5="true" />
<CommFail mask="0xFC" value="0x18" setUser6="true" />
<OutOfSvc mask="0xFC" value="0x1C" setUser7="true" />
<!-- Quality 1 (Uncertain) sub-status /-->
<UncertainX mask="0xFC" value="0x40" />
<NotInit mask="0xFC" value="0x20" setUser8="true" />
<LastUsable mask="0xFC" value="0x44" setUser9="true" />
<SensorCal mask="0xFC" value="0x50" setUser10="true" />
<EguExceed mask="0xFC" value="0x54" setUser11="true" />
<SubNormal mask="0xFC" value="0x58" setUser12="true" />
<!-- Quality 3 (good) sub-status /-->
<GoodX mask="0xFC" value="0xC0" />
<Override mask="0xFC" value="0xD8" setUser13="true" />
<!-- Limit bits -->
<LimitOk mask="0x03" value="0x00" />
<LimitLow mask="0x03" value="0x01" setUser14="true" />
<LimitHigh mask="0x03" value="0x02" setUser15="true" />
<LimitConst mask="0x03" value="0x03" setUser16="true" />
</qualityMapping>
</deviceDefinition>


